package com.yixiu.javabase.modules.keyword.staticfinal;

public class SelfCounter {

    private static int counter; // 静态字段，只有一份，所有类对象共享
    private int id=counter++;  // 对象变量

    public String toString(){
        return "SelfCounter: "+id;
    }

}
